import { BasicColumn, FormSchema } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';
const { t: workbench } = useI18n('dashboard.workbench');
interface GroupItem {
  title: string;
  icon: string;
  color: string;
  desc: string;
  date: string;
  group: string;
}

interface NavItem {
  title: string;
  icon: string;
  color: string;
  component: string;
}

interface DynamicInfoItem {
  avatar: string;
  name: string;
  date: string;
  desc: string;
}

export const navItems: NavItem[] = [
  {
    title: workbench('assetAnalyze'),
    icon: 'ion:home-outline',
    color: '#1fdaca',
    component: '/asset/overview-statistics',
  },
  {
    title: workbench('inventoryAnalyze'),
    icon: 'ion:bar-chart-outline',
    color: '#00d8ff',
    component: '/asset/asset-inventory-analysis',
  },
  {
    title: workbench('position'),
    icon: 'ion:grid-outline',
    color: '#bf0c2c',
    component: '/asset/position',
  },
  {
    title: workbench('assetInfo'),
    icon: 'ion:layers-outline',
    color: '#e18525',
    component: '/asset/asset-info',
  },
  {
    title: workbench('sys'),
    icon: 'ion:settings-outline',
    color: '#3fb27f',
    component: '/dashboard/analysis',
  },
  {
    title: workbench('aseetCategory'),
    icon: 'ion:key-outline',
    color: '#4daf1bc9',
    component: '/assetcategory/assetCategoryList',
  },
];
//这是日志内容配置
import { BasicColumn, FormSchema } from '/@/components/Table';

import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n('monitor.log.fields');
export const logFields = {
  logContent: t('logContent'),
  userid: t('userid'),
  username: t('username'),
  costTime: t('costTime'),
  createTime: t('createTime'),
  logType: t('logType'),
  operateType: t('operateType'),
  keyWord: t('keyWord'),
};
export const columns: BasicColumn[] = [
  {
    title: logFields.logContent,
    dataIndex: 'logContent',
    width: 100,
    align: 'left',
  },
  {
    title: logFields.userid,
    dataIndex: 'userid',
    width: 80,
  },
  {
    title: logFields.username,
    dataIndex: 'username',
    width: 80,
  },
  {
    title: 'IP',
    dataIndex: 'ip',
    width: 80,
  },
  {
    title: logFields.costTime,
    dataIndex: 'costTime',
    width: 80,
  },
  {
    title: logFields.createTime,
    dataIndex: 'createTime',
    sorter: true,
    width: 80,
  },
  {
    title: logFields.logType,
    dataIndex: 'logType_dictText',
    width: 60,
  },
];

/**
 * 操作日志需要操作类型
 */
export const operationLogColumn: BasicColumn[] = [
  ...columns,
  {
    title: logFields.operateType,
    dataIndex: 'operateType_dictText',
    width: 60,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'keyWord',
    label: logFields.keyWord,
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'fieldTime',
    component: 'RangePicker',
    label: logFields.createTime,
    componentProps: {
      valueType: 'Date',
    },
    colProps: {
      span: 8,
    },
  },
];
